package com.kingre.et.dao.jpa;

import java.util.List;

import com.kingre.et.dao.IRoleDAO;
import com.kingre.et.model.Role;

public class RoleDAOJPA extends GenericDAOJPA<Role, Integer> implements IRoleDAO {

    @SuppressWarnings("unchecked")
    public Role findByNameExact(String name) {
        List<Role> list = this.getJpaTemplate().find(
                "from Role where name = ? ", name);
        return list != null && list.size() > 0 ? list.get(0) : null;
    }

}
